//
//  CustomTableCellD.m
//  NewApp
//
//  Created by xueyan liu on 6/22/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CustomTableCellD.h"

@implementation CustomTableCellD

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        frame.size = CGSizeMake(640, 80);
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

-(void) setContentWithTitle:(NSString *)title 
                   subTitle:(NSString *)subTitle 
                  exContent:(NSString *)exContent{
    
    int width = 276;
    if (exContent != NULL) {
        width = 227;
    }
    
    UILabel *lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, 6, width, 15)];
    lblTitle.text = title;
    lblTitle.font = [UIFont fontWithName:@"Arial" size:14];
    [lblTitle setBackgroundColor:[UIColor clearColor]];
    [self addSubview:lblTitle];
    [lblTitle release];
    
    UILabel *lblSubTitle = [[UILabel alloc] initWithFrame:CGRectMake(10,25, width, 15)];
    lblSubTitle.text = subTitle;
    lblSubTitle.font = [UIFont fontWithName:@"Arial" size:14];
    [lblSubTitle setBackgroundColor:[UIColor clearColor]];
    [self addSubview:lblSubTitle];
    [lblSubTitle release];
    
    UILabel *lblExContent = [[UILabel alloc] initWithFrame:CGRectMake(244, 14, 49, 13)];
    lblExContent.text = exContent;
    lblExContent.font = [UIFont fontWithName:@"Arial" size:14];
    [lblExContent setBackgroundColor:[UIColor clearColor]];
    [self addSubview:lblExContent];
    [lblExContent release];
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(295, 12, 11, 15)];
    [imageView setImage:[UIImage imageNamed:@"next_icon.png"]];
    [self addSubview:imageView];
    [imageView release];

}

@end
